Get Notification Feed
The getNotificationFeed() function is used to retrieve the user activity feed, including details about notification items, associated users, topics, widgets, and an error message in case of failure.
Steps to Get Notification Feed
Build a
GetNotificationFeedRequestobject using theGetNotificationFeedRequestBuilderclass.Call the
getNotificationFeed()function using the instance of theLMFeedClientclass.Use the response as per your requirement.
// Build the request object
GetNotificationFeedRequest notificationFeedRequest = (GetNotificationFeedRequestBuilder()
..page(1)
..pageSize(10))
.build();
// Get the response from calling the function
final GetNotificationFeedResponse notificationFeedResponse = await lmFeedClient.getNotificationFeed(notificationFeedRequest);
// Process the response, as per requirement
if(notificationFeedResponse.success){
// your function to handle successful retrieval of notification feed
handleNotificationFeed(notificationFeedResponse);
}else{
// your function to handle error message
handleNotificationFeedError(notificationFeedResponse.errorMessage);
}
Models
GetNotificationFeedRequest
List of parameters for the GetNotificationFeedRequest class
| Variable | Type | Description | Optional |
|---|---|---|---|
| page | int | Page number for pagination | |
| pageSize | int | Number of items per page |
GetNotificationFeedResponse
List of parameters for the GetNotificationFeedResponse class
| Variable | Type | Description | Optional |
|---|---|---|---|
| success | bool | API success status | |
| errorMessage | String | Error message in case of failure | ✔ |
| items | List<NotificationFeedItem> | List of notification items | ✔ |
| users | Map<String, User> | Map of users associated with notifications | ✔ |
| topics | Map<String, Topic> | Map of topics associated with notifications | ✔ |
| widgets | Map<String, WidgetModel> | Map of widgets associated with notifications | ✔ |